package com.kpmg.datalake.web.config;

import com.kpmg.datalake.common.utils.MessageSourceHelperUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;

/**
 * 多语言配置
 *
 * @author Alex.zhao [alex.zhao@kpmg.com]
 * @since Created on azhao6 on 2018-06-28 11:04:17
 */
@Configuration
public class MultilingualConfig {
    /**
     * 多语言处理类
     *
     * @return MessageSourceHelperUtil
     */
    @Bean
    public MessageSourceHelperUtil messageSourceHelper() {
        return new MessageSourceHelperUtil();
    }

    /**
     * ssesion 的locale多语言
     *
     * @return LocaleResolver
     */
    @Bean
    public LocaleResolver localeResolver() {
        return new SessionLocaleResolver();
    }

}
